package com.doubi.controller.sysLog;

import com.doubi.model.sys.TSysLog;
import com.doubi.service.SysLogService;
import com.doubi.vo.AppModel;
import com.doubi.vo.PageVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by IntelliJ IDEA.
 * User: MrDoubi
 * Date: 2019/1/11
 * Time: 16:11
 */
@Controller
@RequestMapping("log")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    /**
     * MrDoubi
     * 2019年1月10日 15:04:57
     * 日志列表页面
     * @return 页面
     */
    @RequiresPermissions("log:list")
    @GetMapping("list")
    public String list(){
        return "web/log/list";
    }


    /**
     * MrDoubi
     * 2019年1月10日 15:05:23
     * 日志列表
     * @return model
     */
    @RequiresPermissions("log:page")
    @PostMapping("page")
    @ResponseBody
    public PageVo<TSysLog> getPage(PageVo<TSysLog> page, TSysLog sysLog){
        return sysLogService.getPage(page,sysLog);
    }


    @RequiresPermissions("log:del")
    @PostMapping("del")
    @ResponseBody
    public AppModel delBean(TSysLog sysLog){
        return sysLogService.delBean(sysLog);
    }

}
